﻿using System.Windows.Controls;

namespace WpfPostgresql
{
    
    /// <summary>
    /// Interaction logic for MagazinsPage.xaml
    /// </summary>
    public partial class MagazinsPage
    {
        public MagazinsPage()
        {
            InitializeComponent();
            DataContext = new ViewModel.MagazinsViewModel();
        }

        private void AcceptBtnClick(object sender, System.Windows.RoutedEventArgs e)
        {
            if (NavigationService != null) NavigationService.GoBack();
        }

        private void ComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TovarList.ItemsSource = ((ViewModel.MagazinsViewModel) DataContext).TovarInMagazs;
        }

        private void ButtonClick(object sender, System.Windows.RoutedEventArgs e)
        {
            TovarList.ItemsSource = ((ViewModel.MagazinsViewModel)DataContext).TovarInMagazs;
        }
    }
}
